﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nate_sRoguelikeGame
{

    class CharacterClass
    {
        public static CharacterClass Elementalist = new CharacterClass() { ChoiceKey = 'E', Name = "Elementalist" };
        public static List<CharacterClass> Classes;

        static CharacterClass()
        {
            Classes = new List<CharacterClass>() { Elementalist };

        }
        public static CharacterClass ChooseClass()
        {
            char[] classChoices = Classes.Select(c => c.ChoiceKey).ToArray();

            char key = Utilities.GetInputKeyChar(String.Format("What class are you?\r\n\r\n{0}\r\n",
                                                           string.Join("\r\n",
                                                                       Classes.Select(
                                                                           c =>
                                                                           String.Format("{0}. {1}", c.ChoiceKey, c.Name)))),
                                             classChoices);
            
            return Classes.Where(c => c.ChoiceKey == key).First();
        }

        public char ChoiceKey { get; set; }
        public string Name { get; set; }
    }


}
